<?php if ($constofsales_report && count($constofsales_report)): ?>

<section class="col-lg-6 ">
    <div class="box box-primary" id="sales_expenses_report_box">
        <div class="box-header">
            <div class="box-title col-md-12 no-padding col-xs-12">
                <h3>{$Think.lang.U8 销售额及费用表}
                    <div class="pull-right unit">
                    <?php echo getUnitHtml('sales_expenses_report'); ?>
                    <?php if(LANG_SET == 'en-us'): ?>
                    <a href="javascript:;" class="text-black" >{$Think.lang.元}</a>
                    <?php else: ?>
                    <?php
                        if (!isset($_SESSION['sales_expenses_report_unit'])) {
                            $sales_w = 'javascript:;';
                            $sales_w_class = 'text-black';
                            $sales_r = '__URL__/index/sales_expenses_report_unit/0';
                        }else {
                            if ($_SESSION['sales_expenses_report_unit'] == 0){
                                    $sales_w = '__URL__/index/sales_expenses_report_unit/1';
                                    $sales_r = 'javascript:;';
                                    $sales_r_class = 'text-black';
                            }else{
                                    $sales_w = 'javascript:;';
                                    $sales_w_class = 'text-black';
                                    $sales_r = '__URL__/index/sales_expenses_report_unit/0';
                            }
                        }
                    ?>
                    <?php endif; ?>
                    </div>
                </h3>
            </div>
            <div class="box-pane">
                <div class="search-form pull-left col-md-3  no-padding">
                    <form  action="__URL__" method="post" id="sales_expenses_form" style="">
                        <label class="" style="margin-left:20px;">{$Think.lang.年份}</label>
                        <select name="sales_expenses_report_year"  onchange="formPosition(this,'sales_expenses_report_box');">
                        <?php $year = !$_SESSION['report_time']['sales_expenses_report_year']? date('Y',time()):$_SESSION['report_time']['sales_expenses_report_year']; ?>
                        {$years | renderOptions = $year}
                        </select>
                    </form>
                </div>
                <div class="pull-right col-md-2 text-right no-padding">
                    <a href="__URL__/exportExcel/report_name/sales_expenses_report" class="glyphicon glyphicon-export" title="excel" style="  padding: 6px;"></a>
                </div>
            </div>
        </div>
        <div class="box-body table-responsive">
            <table class="table table-bordered table-striped" id="sales_expenses_report">
                <thead>
                <tr>
                    <th>{$Think.lang.月份}</th>
                    <th>{$Think.lang.销售金额}</th>
                    <th>{$Think.lang.销售费用}</th>
                </tr>
                </thead>
                <tbody>
                <volist name="constofsales_report.costs" id="cost" >
                    <tr class="text-center">
                        <td>{$cost['imonth']}</td>
                        <td>{$cost['BQ_DFBB']|number_format=1}</td>
                        <td>{$constofsales_report['sales'][$key]|number_format=1}</td>
                    </tr>
                </volist>
                <tr class="text-center">
                    <td>{$Think.lang.合计}</td>
                    <td>{$constofsales_report['total_cost']|number_format=1}</td>
                    <td>{$constofsales_report['total_sale']|number_format=1}</td>
                </tr>
                </tbody>

            </table>
        </div>
    </div>
</section>

<?php endif; ?>


